package com.qcu.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qcu.dto.chart.AppointOfDoctor;
import com.qcu.entity.Appointment;
import com.qcu.mapper.AppointmentMapper;
import com.qcu.service.AppointmentService;
import com.qcu.util.ThreadLocalUtil;
import com.qcu.vo.AppointmentInfoTDVO;
import com.qcu.vo.AppointmentInfoVO;
import com.qcu.vo.DepartmentVO;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
* @author MyComputer
* @description 针对表【appointment】的数据库操作Service实现
* @createDate 2025-02-11 15:50:27
*/
@Service
public class AppointmentServiceImpl extends ServiceImpl<AppointmentMapper, Appointment>
    implements AppointmentService{

    @Resource
    AppointmentMapper appointmentMapper;

    @Override
    public List<DepartmentVO> getDepartmentWithDoctor() {
        List<DepartmentVO> list = appointmentMapper.getDWD();
        return list;
    }

    @Override
    public List<AppointmentInfoVO> getInformationToUser() {
        Map<String,Object> map = ThreadLocalUtil.get();
        Integer id = (Integer) map.get("id");
        return appointmentMapper.getITU(id);
    }

    @Override
    public List<AppointmentInfoTDVO> getAppointmentInfo() {
        Map<String,Object> map = ThreadLocalUtil.get();
        Integer id = (Integer) map.get("id");
        return appointmentMapper.getITD(id);
    }

    @Override
    public List<AppointOfDoctor> getAppoOfDoct() {
        return appointmentMapper.getAppoOfDoct();
    }
}




